package com.aifast.system.sys.dao;

import cn.hutool.core.util.StrUtil;
import com.aifast.system.sys.entity.SysSensitiveWords;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * 敏感词数据Mapper接口
 *
 * @author fujian
 * @date 2022-06-14
 */
@Mapper
public interface SysSensitiveWordsDao extends BaseMapper<SysSensitiveWords>
{

    default LambdaQueryWrapper<SysSensitiveWords> list(String search){
        return new LambdaQueryWrapper<SysSensitiveWords>()
                .like(StrUtil.isNotBlank(search), SysSensitiveWords::getWord, search)
                .orderByDesc(SysSensitiveWords::getId);
    }
}
